package conput;

import java.util.concurrent.ConcurrentHashMap;

public class CHMServer extends Server {

    private final ConcurrentHashMap<Integer, String> posts = new ConcurrentHashMap<Integer, String>();

    public void write(String s) {
        posts.put(size.getAndIncrement(), s);
    }

    public String read(int i) {
        return posts.get(i);
    }

    public int size() {
        return posts.size();
    }
}
